package com.itheima.sync.controller;

import com.itheima.sync.service.DataSyncService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/datasync")
public class DataSyncController {

    @Autowired
    private DataSyncService dataSyncService;

    @GetMapping("/importAll")
    public Result importAll(){
        String s= dataSyncService.importAll();
        return new Result(true, StatusCode.OK,"操作成功",s);
    }
}
